<?php
  session_start();
 require_once('../system/myFunc.php');
 require_once('../system/dbConnect.php'); 
  $username = $_POST["uname"];
  $password = $_POST["password"];  
  connect();
  $sql = "select * from admins where adminname='".$uname."' and password='".$password."'"; 
  $result=fetch_one($sql);
 if($result)
 {
  $_SESSION['user']=$result;
    redirect('userList.php', '登录成功!');
  }else{
    redirect('login.html', '用户名或密码错误！请重新登录！');      
  } 
?>

